<?php
/**
 * 此model不属于csv
 * Enter description here ...
 * @author Administrator
 *
 */
class CSVModel extends Db {
	
	//订单导入导出列表
	private $_order_csv = 'd_order_csv';
	
	public function getCSV($where) {
		return $this->getAll ( $this->_order_csv, $where );
	}
	
	public function top() {
		$sql = "select count(id) num,uid from d_order_csv  group by uid order by num desc ;";
		return $this->fetchAll ( $sql );
	}
	
	/**
	 * 统计数量
	 * @param array $where
	 */
	public function countNum($where) {
		return $this->getNum ( $this->_order_csv, 'id', $where );
	}
	
	public function addOrder($param) {
		$this->add ( $this->_order_csv, $param );
	
		//	return $this->lastInsertId ();
	}
	
	/**
	 * 
	 * @return  CSVModel
	 */
	public static function instance() {
		return self::_instance ( __CLASS__ );
	}

}